import request from '@/utils/request'

// 查询用户地址列表
export function listData(query) {
  return request({
    url: '/data/user/address/listUserAddress',
    method: 'get',
    params: query
  })
}

// 查询select
export function getAllAddress(data) {
  return request({
    url: '/data/user/address/refer',
    method: 'get',
    params: data
  })
}

// 查询用户地址详细
export function getDetail(id) {
  return request({
    url: '/data/user/address/' + id,
    method: 'get'
  })
}

// 新增用户地址
export function addData(data) {
  return request({
    url: '/data/user/address/',
    method: 'post',
    data: data
  })
}


// 修改用户地址
export function updateData(data) {
  return request({
    url: '/data/user/address/',
    method: 'put',
    data: data
  })
}

// 删除用户地址
export function delData(id) {
  return request({
    url: '/data/user/address/' + id,
    method: 'delete'
  })
}


// 获取当地经纬度
export function getPosition(query) {
  return request({
    url: '/api/data/user/address/geo',
    method: 'get',
    params: query
  })
}

//收货地址关联仓库
export function changeWarehouse(data) {
  return request({
    url: '/data/user/address/updateWarehouse',
    method: 'put',
    params: data
  })
}

// 审核
export function checkAddress(query) {
  return request({
    url: '/data/user/address/addressConfirm',
    method: 'put',
    params: query
  })
}

//绑定/解绑配送员
export function bindSender(query) {
  return request({
    url: '/data/user/address/bindSender',
    method: 'put',
    params: query
  })
}

//矫正经纬度
export function checkCenter(data) {
  return request({
    url: '/data/user/address/update/address',
    method: 'put',
    params:data
  })
}

